const jwt = require('jsonwebtoken')
// 生成jwt
// let token = jwt.sign({
// 	username: 'zhangsan',
// 	password: '123456'
// }, 'atguigu', {
// 	expiresIn: 60 * 60 //单位是秒
// })
// console.log(token)

//校验jwt
let token = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6InpoYW5nc2FuIiwicGFzc3dvcmQiOiIxMjM0NTYiLCJpYXQiOjE3NTg2OTgxNDgsImV4cCI6MTc1ODcwMTc0OH0.cRNI0D0glA6dwW4uSdHqJbh5aqnTxXAJf3BdNS4qJbc'
jwt.verify(token, 'atguigu', (data, err) => {
	if (err) {
		console.log(err)
	} else
		console.log(data)

})